import MarkdownIt from "markdown-it";
import markdownQuote from "markdown-it-quote";
import markdownkatex from "@vscode/markdown-it-katex";
import hljs from "markdown-it-highlightjs"

import katex from "katex";
import "katex/contrib/mhchem";
import "katex/contrib/copy-tex";

const md = new MarkdownIt({
//   highlight: function (str, lang) {
//     if (lang && hljs.getLanguage(lang)) {
//       return (
//         '<pre class="hljs"><code>' +
//         hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
//         "</code></pre>"
//       );
//     }

//     return (
//       '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + "</code></pre>"
//     );
//   },
});
md.use(markdownQuote);
md.use(markdownkatex, { katex });
md.use(hljs);

export default md;
